package com.zhn.evsi.client;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Request;
import com.dtflys.forest.annotation.Retry;
import com.dtflys.forest.annotation.Var;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterWalletJournalDTO;
import com.zhn.evsi.interceptor.TokenInterceptor;

import java.util.List;

@BaseRequest(baseURL = "${eveData}${eveDataSns}")
@Retry(maxRetryCount = "3", maxRetryInterval = "1000")
public interface WalletClient {

    /**
     * 钱包金额
     * */
    // https://esi.evetech.net/latest/characters/2119634223/wallet/?datasource=tranquility&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgrCDitjDS%2Fqy1vnK56jjROjovtjJmtDtpW%2B22iAnana00nD6oiFty4mDT2LZT%2BpbGU%2FsdX%2F9XDpafortkUIwIL2BKNYt%2BSWMTCGtV0cynkbziBEN%2Fn2cn6gEVt6gzXKQCISihiX46AgHoTW2G24V1QG
    @Request(
            url = "/characters/{characters}/wallet/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    Double wallet(@Var("characters") Integer characters);

    /**
     * 钱包交易记录
     * */
    // https://esi.evetech.net/latest/characters/2119634223/wallet/journal/?datasource=tranquility&page=1&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgrCDitjDS%2Fqy1vnK56jjROjovtjJmtDtpW%2B22iAnana00nD6oiFty4mDT2LZT%2BpbGU%2FsdX%2F9XDpafortkUIwIL2BKNYt%2BSWMTCGtV0cynkbziBEN%2Fn2cn6gEVt6gzXKQCISihiX46AgHoTW2G24V1QG
    @Request(
            url = "/characters/{characters}/wallet/journal/?datasource=tranquility&page={page}",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<EvsiCharacterWalletJournalDTO> journal(@Var("characters") Integer characters, @Var("page") Integer pageNum);

    /**
     * 钱包市场交易记录
     * */
    // https://esi.evetech.net/latest/characters/2119634223/wallet/transactions/?datasource=tranquility&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgo3pqydxWBIm0JQZ3mhE6y47Z8CxOg5d0VnYGfq9AmLlN5GmuRuw%2FZ9awLHI7%2B8uFvdtxlxuOy9isJ2CEu7j1Ymepa8I91jjJCfc%2BhM72JYRixbr3%2BXIriCprvJVuH583b2csLDNSAcbQS%2FuaJXsbGQ
    @Request(
            url = "/characters/{characters}/wallet/transactions/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<JSONObject> transactions(@Var("characters") Integer characters);

}
